﻿<local:OwnedWindow x:Class="TerraMap.SetWindow"
									 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
									 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
									 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
									 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
									 xmlns:local="clr-namespace:TerraMap"
									 mc:Ignorable="d"
									 Title="Edit Set - TerraMap" Height="300" Width="300"
									 Icon="Resources/App.ico"
									 Loaded="OnLoaded">
	<Window.Resources>
		<Style TargetType="Button">
			<Setter Property="Margin" Value="2" />
			<Setter Property="MinWidth" Value="75" />
		</Style>
		<Style TargetType="TextBox">
			<Setter Property="Margin" Value="2" />
		</Style>
		<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
		<local:InvertedBooleanToVisibilityConverter x:Key="InvertedBooleanToVisibilityConverter" />
	</Window.Resources>
	<Window.CommandBindings>
		<CommandBinding Command="New" CanExecute="OnCanExecuteNew" Executed="OnExecutedNew" />
		<CommandBinding Command="Delete" CanExecute="OnCanExecuteDelete" Executed="OnExecutedDelete" />
		<CommandBinding Command="Close" CanExecute="OnCanExecuteClose" Executed="OnExecutedClose" />
	</Window.CommandBindings>
	<Window.InputBindings>
		<KeyBinding Key="Insert" Command="New" />
		<KeyBinding Key="Delete" Command="Delete" />
		<KeyBinding Key="Esc" Command="Close" />
	</Window.InputBindings>
	<DockPanel LastChildFill="True">
		<Grid DockPanel.Dock="Top">
			<Grid.RowDefinitions>
				<RowDefinition Height="Auto" />
			</Grid.RowDefinitions>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="Auto" />
				<ColumnDefinition Width="*" />
			</Grid.ColumnDefinitions>
			<Label>Name:</Label>
			<TextBox Grid.Column="1" Text="{Binding Set.Name}" />
		</Grid>
		<ToolBarTray DockPanel.Dock="Top">
			<ToolBar Band="0" BandIndex="0" ToolBarTray.IsLocked="True">
				<Button Command="New" ToolTip="Add Items (Insert)">
					<local:AutoGreyableImage Source="Resources/NewDocumentHS.png" Width="16" />
				</Button>
				<Button Command="Delete" ToolTip="Remove Items (Delete)">
					<local:AutoGreyableImage Source="Resources/DeleteHS.png" Width="16" />
				</Button>
			</ToolBar>
		</ToolBarTray>
		<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right">
			<Button IsDefault="True" Click="OnAccept">_OK</Button>
		</StackPanel>
		<ListBox ItemsSource="{Binding Set.ObjectInfoViewModels}" SelectedItem="{Binding SelectedItem}" SelectionMode="Extended">
			<ListBox.Resources>
				<Style TargetType="ListBoxItem">
					<Setter Property="IsSelected" Value="{Binding IsSelected}" />
				</Style>
			</ListBox.Resources>
			<ListBox.ItemTemplate>
				<DataTemplate>
					<TextBlock><Run Text="{Binding Name, Mode=OneWay}"/> (<Run Text="{Binding Type, Mode=OneWay}" />)</TextBlock>
				</DataTemplate>
			</ListBox.ItemTemplate>
		</ListBox>
	</DockPanel>
</local:OwnedWindow>